﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI.WebControls;

namespace System.Web.UI
{
    public class ZMPageSNList<TData, TSModel, TNModel> : ZMPageSNList<TData, TSModel, TNModel, BaseBLL<TSModel>, BaseBLL<TNModel>>
        where TData : SNModel<TSModel, TNModel>, new()
        where TSModel : BaseModel, new()
        where TNModel : BaseModel, new()
    {
    }
    public class ZMPageSNList<TData, TSModel, TNModel, TSBll, TNBll> : ZMPageList<TSBll, TSModel>
        where TData : SNModel<TSModel, TNModel>, new()
        where TSModel : BaseModel, new()
        where TNModel : BaseModel, new()
        where TSBll : BaseBLL<TSModel>, new()
        where TNBll : BaseBLL<TNModel>, new()
    {
        protected override void OnMainGridRowDeleting(GridViewDeleteEventArgs e)
        {
            string id = BaseMainGrid.DataKeys[e.RowIndex].Value.ToString();
            TData data = new TData();
            TNBll bll = new TNBll();
            string filter = data.NRelationFieldName + "=@" + data.NRelationFieldName;
            List<DBParameter> pas = new List<DBParameter>();
            pas.Add(new DBParameter(data.NRelationFieldName, id));
            bll.Delete(filter, pas);
            bll.Dispose();
            base.OnMainGridRowDeleting(e);
        }
    }

    public class ZMPageSNNList<TData, TNData, TModel, TNModel, TNNModel>
        : ZMPageSNNList<TData, TNData, TModel, TNModel, TNNModel, BaseBLL<TModel>, BaseBLL<TNModel>, BaseBLL<TNNModel>>
        where TModel : BaseModel, new()
        where TNModel : BaseModel, new()
        where TNNModel : BaseModel, new()
        where TData : SNDataModel<TModel, TNModel, TNNModel, TNData>, new()
        where TNData : SNModel<TNModel, TNNModel>, new()
    {

    }
    public class ZMPageSNNList<TData, TNData, TModel, TNModel, TNNModel, TBll, TNBll, TNNBll> : ZMPageList<TBll, TModel>
        where TModel : BaseModel, new()
        where TNModel : BaseModel, new()
        where TNNModel : BaseModel, new()
        where TBll : BaseBLL<TModel>, new()
        where TNBll : BaseBLL<TNModel>, new()
        where TNNBll : BaseBLL<TNNModel>, new()
        where TData : SNDataModel<TModel, TNModel, TNNModel, TNData>, new()
        where TNData : SNModel<TNModel, TNNModel>, new()
    {
        protected override void OnMainGridRowDeleting(GridViewDeleteEventArgs e)
        {
            //string id = BaseMainGrid.DataKeys[e.RowIndex].Value.ToString();
           // base.OnMainGridRowDeleting(e);
        }
    }
}
